#!/bin/sh
########################################################################
# Begin fcron
#
# Description : deluge-daemon
#
#
########################################################################

### BEGIN INIT INFO
# Provides:            deluged
### END INIT INFO

. /lib/lsb/init-functions

BIN_FILE="/usr/lib/plexmediaserver/Plex Media Server"

#$LastChangedBy: dj $
#$Date: 2019-09-08 13:50:13 -0500 (Sun, 08 Sep 2019) $

case "$1" in
   start)
      log_info_msg "Starting plex..."
      start_daemon "${BIN_FILE}"&
      evaluate_retval
      ;;

   stop)
      	log_info_msg "Stopping plex..."
	killproc "${BIN_FILE}"
      	evaluate_retval
      ;;
   status)
       pidof "${BIN_FILE}"
       ;;
   restart)
      $0 stop
      sleep 1
      $0 start
      ;;
   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/fcron
